package com.byedu.domain.course;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

/**
 * 用户与课程信息关联实体
 * Created by jason on 2017/5/21.
 */
public class UserLibraryDO implements Serializable {

    /*主键*/
    private Integer id;

    /*流水号*/
    private String serialno;

    /*用户Id*/
    private String userId;

    /*试卷  对应bay_library的主键*/
    private Integer libraryId;

    /*答题花费时间*/
    private int consumedTime;

    /*创建时间*/
    private String createdTime;

    /*错误题数*/
    private int wrongSum;

    /*正确题数*/
    private int rightSum;

    /*总题数*/
    private int total;

    /*得分*/
    private int score;

    /*答案列表*/
    private String answerlist;

    /**错题集合**/
    private List<UserQuestionErrDO> userQuestionErrDOList;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getSerialno() {
        return serialno;
    }

    public void setSerialno(String serialno) {
        this.serialno = serialno;
    }

    public Integer getLibraryId() {
        return libraryId;
    }

    public void setLibraryId(Integer libraryId) {
        this.libraryId = libraryId;
    }

    public int getConsumedTime() {
        return consumedTime;
    }

    public void setConsumedTime(int consumedTime) {
        this.consumedTime = consumedTime;
    }

    public String getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(String createdTime) {
        this.createdTime = createdTime;
    }

    public int getWrongSum() {
        return wrongSum;
    }

    public void setWrongSum(int wrongSum) {
        this.wrongSum = wrongSum;
    }

    public int getRightSum() {
        return rightSum;
    }

    public void setRightSum(int rightSum) {
        this.rightSum = rightSum;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

    public String getAnswerlist() {
        return answerlist;
    }

    public void setAnswerlist(String answerlist) {
        this.answerlist = answerlist;
    }


    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public List<UserQuestionErrDO> getUserQuestionErrDOList() {
        return userQuestionErrDOList;
    }

    public void setUserQuestionErrDOList(List<UserQuestionErrDO> userQuestionErrDOList) {
        this.userQuestionErrDOList = userQuestionErrDOList;
    }

    public UserLibraryDO() {
    }

    public UserLibraryDO(UserQuestionPost userQuestionPost,String serialno) {
        this.setUserId(userQuestionPost.getUserId());
        this.setAnswerlist(userQuestionPost.getAnswer());
        this.setLibraryId(userQuestionPost.getLibraryId());
        this.setConsumedTime(userQuestionPost.getTime());
//        userLibraryDO.setTotal(ls.size());
        SimpleDateFormat timeSDF = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String creatTime = timeSDF.format(new Date());
        this.setCreatedTime(creatTime);

        this.setSerialno(serialno);
    }
}
